//package com.one.apartmentsystem.common.handler;
//
//import com.alibaba.fastjson.JSON;
//import lombok.SneakyThrows;
//import org.apache.ibatis.type.BaseTypeHandler;
//import org.apache.ibatis.type.JdbcType;
//import org.apache.ibatis.type.MappedJdbcTypes;
//import org.apache.ibatis.type.MappedTypes;
//import java.sql.CallableStatement;
//import java.sql.PreparedStatement;
//import java.sql.ResultSet;
//import java.sql.SQLException;
//import java.util.List;
//
//@MappedTypes(value = { List.class })
//@MappedJdbcTypes(value = JdbcType.VARCHAR)
//public class JsonStringArrayTypeHandler extends BaseTypeHandler<List<String>> {
//
//	@Override
//	public void setNonNullParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType)
//			throws SQLException {
//		ps.setString(i, JSON.toJSONString(parameter));
//	}
//
//	@Override
//	@SneakyThrows
//	public List<String> getNullableResult(ResultSet rs, String columnName) {
//		String reString = rs.getString(columnName);
//		return JSON.parseArray(reString,String.class);
//	}
//
//	@Override
//	@SneakyThrows
//	public List<String> getNullableResult(ResultSet rs, int columnIndex) {
//		String reString = rs.getString(columnIndex);
//		return JSON.parseArray(reString,String.class);
//	}
//
//	@Override
//	@SneakyThrows
//	public List<String> getNullableResult(CallableStatement cs, int columnIndex) {
//		String reString = cs.getString(columnIndex);
//		return JSON.parseArray(reString,String.class);
//	}
//}
